class yumlocal::repos_umd (
  $umd_priority = 40
)inherits yumlocal{

  case $facts['os']['release']['major'] {
  '5': {
     yumrepo { "EMI_3_base":
        baseurl => "http://${mirrorserver}/yum/emi/3/sl5/x86_64/base",
        descr   => "EMI_3_base",
        enabled => 1,
        gpgcheck => 0,
        priority => 40,
        before   => Yumrepo['site']
     }
     yumrepo { "EMI_3_contribs":
        baseurl => "http://${mirrorserver}/yum/emi/3/sl5/x86_64/contribs",
        descr   => "EMI_3_contribs",
        enabled => 1,
        gpgcheck => 0,
        priority => 40,
        before   => Yumrepo['site']
     }
     yumrepo { "EMI_3_updates":
        baseurl => "http://${mirrorserver}/yum/emi/3/sl5/x86_64/updates",
        descr   => "EMI_3_updates",
        enabled => 1,
        gpgcheck => 0,
        priority => 40,
        before   => Yumrepo['site']
     }
     yumrepo { "wlcg":
        baseurl => "http://${mirrorserver}/yum/wlcg/sl$facts['os']['release']['major']/x86_64",
        descr   => "wlcg",
        enabled => 1,
        gpgcheck => 0,
        priority => 43,
        before   => Yumrepo['site']
     }
   }
  '6': {
     #yumrepo { "UMD_4_base":
     #   baseurl => "http://${mirrorserver}/yum/umd/4/sl6/x86_64/base",
     #   descr   => "UMD_4_base",
     #   enabled => 1,
     #   gpgcheck => 0,
     #   exclude  =>'cvmfs-config-egi',
     #   priority => $umd_priority,
     #   before   => Yumrepo['site']
     #}
     #yumrepo { "UMD_4_updates":
     #   baseurl => "http://${mirrorserver}/yum/umd/4/sl6/x86_64/updates",
     #   descr   => "UMD_4_updates",
     #   enabled => 1,
     #   gpgcheck => 0,
     #   exclude  =>'cvmfs-config-egi',
     #   priority => $umd_priority,
     #   before   => Yumrepo['site']
     #}
     yumrepo { "wlcg":
        baseurl => "http://${mirrorserver}/yum/wlcg/sl$facts['os']['release']['major']/x86_64",
        descr   => "wlcg",
        enabled => 1,
        gpgcheck => 0,
        priority => 33,
        before   => Yumrepo['site']
     }
  }
  '7': {
     yumrepo { "UMD_4_base":
        baseurl => "http://${mirrorserver}/yum/umd/4/centos7/x86_64/base",
        descr   => "UMD_4_base",
        enabled => 1,
        gpgcheck => 0,
	exclude  =>'cvmfs-config-egi',
        priority => $umd_priority,
        before   => Yumrepo['site']
     }
     yumrepo { "UMD_4_updates":
        baseurl => "http://${mirrorserver}/yum/umd/4/centos7/x86_64/updates",
        descr   => "UMD_4_updates",
        enabled => 1,
        gpgcheck => 0,
	exclude  =>'cvmfs-config-egi',
        priority => $umd_priority,
        before   => Yumrepo['site']
     }
     yumrepo { "wlcg":
        baseurl => "http://${mirrorserver}/yum/wlcg/centos7/x86_64",
        descr   => "wlcg",
        enabled => 1,
        gpgcheck => 0,
        priority => 33,
        before   => Yumrepo['site']
     }
  }
 '9': {
     yumrepo { "wlcg":
        baseurl => "http://${mirrorserver}/yum/wlcg/el9/\$basearch",
        descr   => "wlcg",
        enabled => 1,
        gpgcheck => 0,
        priority => 33,
        before   => Yumrepo['site']
     }
  }
  }

   yumrepo { "EGI-trustanchors":
      baseurl => "http://${mirrorserver}/yum/ca",
      descr   => "EGI-trustanchors",
      enabled => 1,
      gpgcheck => 0,
      priority => 43,
      before   => Yumrepo['site']
   }
}
